Project’s Objective

This project aims to efficiently replicate the results obtained in (Boutton and D’Orazio 2020). For this purpose, I use R and the same dataset employed by the original authors. The paper is published in the Journal of Peace Research, the leading journal in peace studies. I express my gratitude to the authors for their valuable theoretical contributions to advancing the field of peace research, as well as for making their data available for replication.

Theoretical Contributions

Without a theoretical foundation, any analysis is meaningless. This article makes two key theoretical contributions: * It challenges the prevailing view that aid allocation is solely driven by the security interests of donor states. * It shows how major powers leverage foreign aid to influence smaller states in pursuit of their interests. This raises important questions about the role of foreign aid in enabling large-scale collective action, including: + Multilateral military intervention + Compliance with environmental agreements

Hypotheses :

  • H1 :

    • H1.1 Token troop contributors in year \(t-1\) will receive more aid from the relevant pivotal state(s) in year t than non-contributors.(See Table 2)
    • H1.2 Major troop contributors in year \(t-1\) will receive more aid from the relevant pivotal state(s) in year \(t\) than token contributors. (See Table 3)
  • H2 : Contributing countries will receive more aid from relevant pivotal states in year \(t\) as their number of personnel killed in the mission in year \(t-1\) increases.(See Table 4)

  • H3 : As level of aid from pivotal states in year \(t-1\) increases, the likelihood of a state contributing personnel to the corresponding mission in year \(t\) increases. (See Table 6)

  • H4 : As the level of aid from pivotal states in year \(t-1\) increases, the number of personnel committed to the corresponding mission in year \(t\) increases. (See Table 6)

Quantitaive Replication

For a better structuring of the replication procedures, I will first reproduce tables then figures.

Tables

#Loading required libraries
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.1.3
## Warning: package 'tibble' was built under R version 4.1.3
## Warning: package 'tidyr' was built under R version 4.1.3
## Warning: package 'readr' was built under R version 4.1.3
## Warning: package 'purrr' was built under R version 4.1.3
## Warning: package 'dplyr' was built under R version 4.1.3
## Warning: package 'stringr' was built under R version 4.1.3
## Warning: package 'forcats' was built under R version 4.1.3
## Warning: package 'lubridate' was built under R version 4.1.3
## Warning in Sys.timezone(): unable to identify current timezone 'S':
## please set environment variable 'TZ'
## -- Attaching core tidyverse packages ------------------------ tidyverse 2.0.0 --
## v dplyr     1.1.1     v readr     2.1.4
## v forcats   1.0.0     v stringr   1.5.0
## v ggplot2   3.4.4     v tibble    3.2.1
## v lubridate 1.9.2     v tidyr     1.3.0
## v purrr     1.0.1     
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## i Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readr)
library(moderndive)
library(broom)
## Warning: package 'broom' was built under R version 4.1.3
library(texreg)
## Warning: package 'texreg' was built under R version 4.1.3
## Version:  1.38.6
## Date:     2022-04-06
## Author:   Philip Leifeld (University of Essex)
## 
## Consider submitting praise using the praise or praise_interactive functions.
## Please cite the JSS article in your publications -- see citation("texreg").
## 
## Attaching package: 'texreg'
## 
## The following object is masked from 'package:tidyr':
## 
##     extract
#Importing the data (there are various ways and this is my favorite; I never had a problem with it in different version of R)
path<-file.path("C:\\Users\\hassa\\OneDrive\\Documents\\R\\Datasets\\bbhdata_mission.tsv")
data<-read_tsv(path)
## Rows: 95608 Columns: 72
## -- Column specification --------------------------------------------------------
## Delimiter: "\t"
## chr  (4): FirstMission, Pivotal, country, Mission_Country
## dbl (68): ccodecow, year, Mission_Country_ccodecow, decade, PKinState, numBo...
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(data)
## # A tibble: 6 x 72
##   FirstMission ccodecow  year Pivotal   country       Mission_Country
##   <chr>           <dbl> <dbl> <chr>     <chr>         <chr>          
## 1 UNFICYP             2  1970 365;2;200 United States Cyprus         
## 2 UNFICYP             2  1971 365;2;200 United States Cyprus         
## 3 UNFICYP             2  1972 365;2;200 United States Cyprus         
## 4 UNFICYP             2  1973 365;2;200 United States Cyprus         
## 5 UNEF                2  1973 365;2     United States Egypt          
## 6 UNFICYP             2  1974 365;2;200 United States Cyprus         
## # i 66 more variables: Mission_Country_ccodecow <dbl>, decade <dbl>,
## #   PKinState <dbl>, numBorderPKs <dbl>, dac <dbl>, oecd_flag <dbl>,
## #   Total <dbl>, Troops <dbl>, NonCombatPers <dbl>, token_contributor <dbl>,
## #   token_1_10 <dbl>, token_11_40 <dbl>, major_contributor <dbl>,
## #   non_contributor <dbl>, lag_major_contributor <dbl>,
## #   lag_non_contributor <dbl>, lag_token_contributor <dbl>,
## #   lag_token_1_10 <dbl>, lag_token_11_40 <dbl>, total_deaths <dbl>, ...

Table 1 : Top budget and personnel contributors, 1990–2015

I replicate the results presented on the right-hand side , as the authors did not provide data for the left-hand side.

# Specifying the time interval between 1990 and 2015
top10 <- data %>%
  filter(year >= 1990 & year <= 2015) %>%
  
  # Aggregation of Total by country
  group_by(country) %>%
  summarise(Total = sum(Total, na.rm = TRUE)) %>%
  
  # Arranging in descending order of Total
  arrange(desc(Total)) %>%
  
  # Select the top 10 countries
  slice(1:10)

# Show the result
print(top10)
## # A tibble: 10 x 2
##    country     Total
##    <chr>       <dbl>
##  1 Pakistan   153888
##  2 Bangladesh 149278
##  3 India      118234
##  4 Nigeria     67786
##  5 Nepal       65593
##  6 Ghana       57761
##  7 Jordan      56234
##  8 Ethiopia    53943
##  9 France      40383
## 10 Egypt       39106

Table 2 : Do pivotal UN member states give more aid to troop-contributing countries?

library(tidyverse)

library(dplyr)
library(broom)
library(texreg)

# Define the subsets
data_1990 <- data %>% filter(year < 1990 & dac == 0)
data_1990_1999 <- data %>% filter(year > 1989 & year < 2000 & dac == 0)
data_2000_2015 <- data %>% filter(year > 1999 & year < 2016 & dac == 0)
data_decades <- data %>% filter(year > 1989 & year < 2016 & dac == 0)

# Fit the models
model1 <- lm(log_pivotal_aid ~ lag_token_contributor + lag_major_contributor + lag_non_contributor + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990)
model2 <- lm(log_pivotal_aid ~ lag_token_contributor + lag_major_contributor + lag_non_contributor + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990_1999)
model3 <- lm(log_pivotal_aid ~ lag_token_contributor + lag_major_contributor + lag_non_contributor + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_2000_2015)
model4 <- lm(log_pivotal_aid ~ lag_token_contributor + lag_major_contributor + lag_non_contributor + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow) + as.factor(decade), data = data_decades)

# Create a list of models
model_list <- list(model1, model2, model3, model4)

# Display results
texreg(model_list, digits = 2, omit.coef = "as.factor", custom.note = "Standard errors are in parentheses. %stars")
## 
## \begin{table}
## \begin{center}
## \begin{tabular}{l c c c c}
## \hline
##  & Model 1 & Model 2 & Model 3 & Model 4 \\
## \hline
## (Intercept)             & $-188.18^{***}$ & $84.85^{***}$ & $231.80^{***}$ & $69.06^{***}$ \\
##                         & $(15.36)$       & $(15.50)$     & $(6.22)$       & $(4.74)$      \\
## lag\_token\_contributor & $2.20$          & $2.40^{***}$  & $0.61^{**}$    & $0.85^{***}$  \\
##                         & $(2.85)$        & $(0.46)$      & $(0.21)$       & $(0.20)$      \\
## lag\_major\_contributor & $1.12$          & $3.63^{***}$  & $2.03^{***}$   & $2.05^{***}$  \\
##                         & $(0.89)$        & $(0.51)$      & $(0.21)$       & $(0.20)$      \\
## l.loggdppc              & $1.64^{**}$     & $-0.53$       & $-8.17^{***}$  & $-3.16^{***}$ \\
##                         & $(0.52)$        & $(0.42)$      & $(0.24)$       & $(0.15)$      \\
## l.logpop                & $14.37^{***}$   & $-5.89^{***}$ & $-11.48^{***}$ & $-2.69^{***}$ \\
##                         & $(1.11)$        & $(1.21)$      & $(0.44)$       & $(0.33)$      \\
## infmort\_lag            & $-0.07^{***}$   & $-0.07^{***}$ & $0.00$         & $-0.00$       \\
##                         & $(0.01)$        & $(0.02)$      & $(0.01)$       & $(0.00)$      \\
## l.dem                   & $0.96^{*}$      & $0.14$        & $1.03^{***}$   & $0.12$        \\
##                         & $(0.39)$        & $(0.31)$      & $(0.17)$       & $(0.13)$      \\
## \hline
## R$^2$                   & $0.57$          & $0.28$        & $0.31$         & $0.26$        \\
## Adj. R$^2$              & $0.56$          & $0.27$        & $0.31$         & $0.25$        \\
## Num. obs.               & $5357$          & $18196$       & $44578$        & $62774$       \\
## \hline
## \multicolumn{5}{l}{\scriptsize{Standard errors are in parentheses. $^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}}
## \end{tabular}
## \caption{Statistical models}
## \label{table:coefficients}
## \end{center}
## \end{table}
screenreg(model_list, digits = 2, omit.coef = "as.factor", custom.note = "Standard errors are in parentheses. %stars")
## 
## ============================================================================
##                        Model 1      Model 2       Model 3       Model 4     
## ----------------------------------------------------------------------------
## (Intercept)            -188.18 ***     84.85 ***    231.80 ***     69.06 ***
##                         (15.36)       (15.50)        (6.22)        (4.74)   
## lag_token_contributor     2.20          2.40 ***      0.61 **       0.85 ***
##                          (2.85)        (0.46)        (0.21)        (0.20)   
## lag_major_contributor     1.12          3.63 ***      2.03 ***      2.05 ***
##                          (0.89)        (0.51)        (0.21)        (0.20)   
## l.loggdppc                1.64 **      -0.53         -8.17 ***     -3.16 ***
##                          (0.52)        (0.42)        (0.24)        (0.15)   
## l.logpop                 14.37 ***     -5.89 ***    -11.48 ***     -2.69 ***
##                          (1.11)        (1.21)        (0.44)        (0.33)   
## infmort_lag              -0.07 ***     -0.07 ***      0.00         -0.00    
##                          (0.01)        (0.02)        (0.01)        (0.00)   
## l.dem                     0.96 *        0.14          1.03 ***      0.12    
##                          (0.39)        (0.31)        (0.17)        (0.13)   
## ----------------------------------------------------------------------------
## R^2                       0.57          0.28          0.31          0.26    
## Adj. R^2                  0.56          0.27          0.31          0.25    
## Num. obs.              5357         18196         44578         62774       
## ============================================================================
## Standard errors are in parentheses. *** p < 0.001; ** p < 0.01; * p < 0.05

Table 3 : Foreign aid and troop contribution size

library(pander)
## Warning: package 'pander' was built under R version 4.1.3
# Perform the calculations
results <- tibble(
  Change_in_contributor_status = c(
    "Non-contributor → Token contributor", 
    "Token contributor → Major contributor"
  ),
  Predicted_aid_increase = c(
    (exp(.85) - 1) * 100, 
    (exp(1.206383) - 1) * 100
  ),
  CI_lower = c(
    (exp(0.46331948) - 1) * 100, 
    (exp(0.67735490) - 1) * 100
  ),
  CI_upper = c(
    (exp(1.228492054) - 1) * 100, 
    (exp(1.735411026) - 1) * 100
  )
)

# Create a LaTeX-style table
results_table <- results %>%
  mutate(
    Predicted_aid_increase = sprintf("%.2f%%", Predicted_aid_increase),
    CI = paste0("[", sprintf("%.2f%%", CI_lower), "–", sprintf("%.2f%%", CI_upper), "]")
  ) %>%
  dplyr::select(Change_in_contributor_status, Predicted_aid_increase, CI)

# Print the table in LaTeX format
pander(results_table, 
       caption = "Table III. Foreign aid and troop contribution size",
       split.tables = 120)
Table III. Foreign aid and troop contribution size ### Table 4 : UN peacekeeping fatalities and foreign aid from pivotal states
Change_in_contributor_status Predicted_aid_increase CI
Non-contributor <U+2192> Token contributor 133.96% [58.93%–241.61%]
Token contributor <U+2192> Major contributor 234.14% [96.87%–467.13%]
library(dplyr)
library(broom)
library(texreg)

# Define the subsets for the new models
data_1990_cold_war <- data %>% filter(year <= 1989 & dac == 0 & lag_contributed == 1)
data_1990_1999_cold_war <- data %>% filter(year > 1989 & year < 2000 & dac == 0 & lag_contributed == 1)
data_2000_2015_cold_war <- data %>% filter(year > 1999 & year < 2016 & dac == 0 & lag_contributed == 1)
data_post_cw <- data %>% filter(year > 1989 & year < 2016 & dac == 0 & lag_contributed == 1)
data_post_cw_decade <- data %>% filter(year > 1989 & year < 2016 & dac == 0 & lag_contributed == 1)

# Fit the new models
model5 <- lm(log_pivotal_aid ~ lag_log_total_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990_cold_war)
model6 <- lm(log_pivotal_aid ~ lag_log_total_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990_1999_cold_war)
model7 <- lm(log_pivotal_aid ~ lag_log_total_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_2000_2015_cold_war)
model8 <- lm(log_pivotal_aid ~ lag_log_total_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_post_cw)
model9 <- lm(log_pivotal_aid ~ lag_log_total_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow) + as.factor(decade), data = data_post_cw_decade)

# Collect and tidy model summaries with confidence intervals
model_summaries <- map_df(list(model5, model6, model7, model8, model9), broom::tidy, conf.int = TRUE, .id = "model")

# Exponentiate coefficients and confidence intervals
model_summaries <- model_summaries %>%
  filter(term != "(Intercept)" & !str_detect(term, "as.factor")) %>%
  mutate(
    estimate_exp = exp(estimate) - 1,
    conf.low_exp = exp(conf.low) - 1,
    conf.high_exp = exp(conf.high) - 1,
    estimate_exp = sprintf("%.2f%%", estimate_exp * 100),
    conf.low_exp = sprintf("%.2f%%", conf.low_exp * 100),
    conf.high_exp = sprintf("%.2f%%", conf.high_exp * 100)
  ) %>%
  dplyr::select(model, term, estimate_exp, conf.low_exp, conf.high_exp) %>%
  pivot_wider(names_from = model, values_from = c(estimate_exp, conf.low_exp, conf.high_exp))

# Create and print the LaTeX table
texreg(list(model5, model6, model7, model8, model9), 
       digits = 2, 
       omit.coef = "as.factor", 
       custom.note = "Standard errors are in parentheses. Sample includes only states that contributed in year $t-1$. %stars",
       caption = "Model Results with Exponentiated Coefficients")
## 
## \begin{table}
## \begin{center}
## \begin{tabular}{l c c c c c}
## \hline
##  & Model 1 & Model 2 & Model 3 & Model 4 & Model 5 \\
## \hline
## (Intercept)             & $-46.64$   & $39.09$     & $473.29^{***}$ & $193.04^{***}$ & $155.52^{***}$ \\
##                         & $(457.54)$ & $(78.86)$   & $(31.63)$      & $(19.80)$      & $(21.49)$      \\
## lag\_log\_total\_deaths & $1.92$     & $1.72^{**}$ & $1.37^{***}$   & $1.51^{***}$   & $1.55^{***}$   \\
##                         & $(1.14)$   & $(0.66)$    & $(0.28)$       & $(0.27)$       & $(0.26)$       \\
## l.loggdppc              & $-3.75$    & $-5.09^{*}$ & $-13.89^{***}$ & $-11.37^{***}$ & $-10.48^{***}$ \\
##                         & $(11.20)$  & $(2.41)$    & $(0.72)$       & $(0.55)$       & $(0.61)$       \\
## l.logpop                & $7.03$     & $0.89$      & $-21.42^{***}$ & $-6.38^{***}$  & $-4.10^{**}$   \\
##                         & $(26.36)$  & $(6.16)$    & $(1.86)$       & $(1.36)$       & $(1.43)$       \\
## infmort\_lag            & $-0.15$    & $0.03$      & $-0.02$        & $0.02$         & $0.02$         \\
##                         & $(0.25)$   & $(0.07)$    & $(0.02)$       & $(0.02)$       & $(0.02)$       \\
## l.dem                   & $-1.62$    & $-0.45$     & $1.28^{***}$   & $0.26$         & $-0.08$        \\
##                         & $(2.71)$   & $(1.79)$    & $(0.34)$       & $(0.29)$       & $(0.29)$       \\
## \hline
## R$^2$                   & $0.77$     & $0.31$      & $0.35$         & $0.29$         & $0.31$         \\
## Adj. R$^2$              & $0.69$     & $0.26$      & $0.34$         & $0.28$         & $0.30$         \\
## Num. obs.               & $56$       & $1323$      & $6665$         & $7988$         & $7988$         \\
## \hline
## \multicolumn{6}{l}{\scriptsize{Standard errors are in parentheses. Sample includes only states that contributed in year $t-1$. $^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}}
## \end{tabular}
## \caption{Model Results with Exponentiated Coefficients}
## \label{table:coefficients}
## \end{center}
## \end{table}

Table 5: UN peacekeeping fatalities and foreign aid from pivotal states: Troops vs non-combat personnel deaths

library(dplyr)
library(broom)
library(purrr)
library(tidyr)

# Define the subsets
data_cold_war <- data %>% filter(year <= 1989 & dac == 0 & lag_contributed == 1)
data_1990s <- data %>% filter(year > 1989 & year < 2000 & dac == 0 & lag_contributed == 1)
data_post_2000 <- data %>% filter(year > 1999 & year < 2016 & dac == 0 & lag_contributed == 1)
data_post_cw <- data %>% filter(year > 1989 & year < 2016 & dac == 0 & lag_contributed == 1)

# Fit the models
model10 <- lm(log_pivotal_aid ~ lag_log_troop_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_cold_war)
model11 <- lm(log_pivotal_aid ~ lag_log_police_observer_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_cold_war)
model12 <- lm(log_pivotal_aid ~ lag_log_troop_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990s)
model13 <- lm(log_pivotal_aid ~ lag_log_police_observer_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_1990s)
model14 <- lm(log_pivotal_aid ~ lag_log_troop_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_post_2000)
model15 <- lm(log_pivotal_aid ~ lag_log_police_observer_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow), data = data_post_2000)
model16 <- lm(log_pivotal_aid ~ lag_log_troop_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow) + as.factor(decade), data = data_post_cw)
model17 <- lm(log_pivotal_aid ~ lag_log_police_observer_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem + as.factor(ccodecow) + as.factor(decade), data = data_post_cw)

# Create a list of models
model_list <- list(model10, model11, model12, model13, model14, model15, model16, model17)

# Generate model summaries using broom
model_summaries <- map_dfr(seq_along(model_list), function(i) {
  tidy(model_list[[i]], conf.int = TRUE, exponentiate = TRUE) %>%
    mutate(model = paste0("Model ", i)) %>%
    filter(term != "(Intercept)" & !str_detect(term, "as.factor"))
}, .id = "model_id")

# Create a LaTeX-style table
results_table <- model_summaries %>%
  mutate(
    estimate_exp = (estimate - 1) * 100,
    conf.low_exp = (conf.low - 1) * 100,
    conf.high_exp = (conf.high - 1) * 100,
    estimate_exp = sprintf("%.2f%%", estimate_exp),
    conf.low_exp = sprintf("%.2f%%", conf.low_exp),
    conf.high_exp = sprintf("%.2f%%", conf.high_exp)
  ) %>%
  dplyr::select(model, term, estimate_exp, conf.low_exp, conf.high_exp) %>%
  pivot_wider(names_from = model, values_from = c(estimate_exp, conf.low_exp, conf.high_exp))

# Display results
texreg(model_list, digits = 2, omit.coef = "as.factor", custom.note = "Standard errors are in parentheses. %stars")
## 
## \begin{table}
## \begin{center}
## \begin{tabular}{l c c c c c c c c}
## \hline
##  & Model 1 & Model 2 & Model 3 & Model 4 & Model 5 & Model 6 & Model 7 & Model 8 \\
## \hline
## (Intercept)                        & $-46.64$   & $97.01$    & $37.77$     & $35.17$   & $470.40^{***}$ & $470.61^{***}$ & $153.25^{***}$ & $152.17^{***}$ \\
##                                    & $(457.54)$ & $(459.23)$ & $(78.81)$   & $(79.06)$ & $(31.67)$      & $(31.60)$      & $(21.51)$      & $(21.48)$      \\
## lag\_log\_troop\_deaths            & $1.92$     &            & $1.99^{**}$ &           & $0.82^{**}$    &                & $1.18^{***}$   &                \\
##                                    & $(1.14)$   &            & $(0.71)$    &           & $(0.31)$       &                & $(0.29)$       &                \\
## l.loggdppc                         & $-3.75$    & $-5.41$    & $-5.14^{*}$ & $-4.72$   & $-13.91^{***}$ & $-13.86^{***}$ & $-10.49^{***}$ & $-10.48^{***}$ \\
##                                    & $(11.20)$  & $(11.40)$  & $(2.41)$    & $(2.41)$  & $(0.72)$       & $(0.72)$       & $(0.61)$       & $(0.61)$       \\
## l.logpop                           & $7.03$     & $-1.66$    & $1.04$      & $0.88$    & $-21.23^{***}$ & $-21.27^{***}$ & $-3.91^{**}$   & $-3.83^{**}$   \\
##                                    & $(26.36)$  & $(26.41)$  & $(6.16)$    & $(6.18)$  & $(1.86)$       & $(1.85)$       & $(1.43)$       & $(1.43)$       \\
## infmort\_lag                       & $-0.15$    & $-0.24$    & $0.03$      & $0.05$    & $-0.02$        & $-0.02$        & $0.02$         & $0.02$         \\
##                                    & $(0.25)$   & $(0.25)$   & $(0.07)$    & $(0.07)$  & $(0.02)$       & $(0.02)$       & $(0.02)$       & $(0.02)$       \\
## l.dem                              & $-1.62$    & $-0.40$    & $-0.52$     & $-0.30$   & $1.28^{***}$   & $1.27^{***}$   & $-0.08$        & $-0.11$        \\
##                                    & $(2.71)$   & $(2.66)$   & $(1.79)$    & $(1.80)$  & $(0.34)$       & $(0.34)$       & $(0.29)$       & $(0.29)$       \\
## lag\_log\_police\_observer\_deaths &            &            &             & $0.59$    &                & $3.76^{***}$   &                & $3.20^{***}$   \\
##                                    &            &            &             & $(1.83)$  &                & $(0.71)$       &                & $(0.68)$       \\
## \hline
## R$^2$                              & $0.77$     & $0.75$     & $0.31$      & $0.31$    & $0.35$         & $0.35$         & $0.31$         & $0.31$         \\
## Adj. R$^2$                         & $0.69$     & $0.67$     & $0.26$      & $0.26$    & $0.34$         & $0.34$         & $0.30$         & $0.30$         \\
## Num. obs.                          & $56$       & $56$       & $1323$      & $1323$    & $6665$         & $6665$         & $7988$         & $7988$         \\
## \hline
## \multicolumn{9}{l}{\scriptsize{Standard errors are in parentheses. $^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}}
## \end{tabular}
## \caption{Statistical models}
## \label{table:coefficients}
## \end{center}
## \end{table}
screenreg(model_list, digits = 2, omit.coef = "as.factor", custom.note = "Standard errors are in parentheses. %stars")
## 
## ============================================================================================================================
##                                 Model 1   Model 2   Model 3     Model 4   Model 5      Model 6      Model 7      Model 8    
## ----------------------------------------------------------------------------------------------------------------------------
## (Intercept)                      -46.64     97.01     37.77       35.17    470.40 ***   470.61 ***   153.25 ***   152.17 ***
##                                 (457.54)  (459.23)   (78.81)     (79.06)   (31.67)      (31.60)      (21.51)      (21.48)   
## lag_log_troop_deaths               1.92                1.99 **               0.82 **                   1.18 ***             
##                                   (1.14)              (0.71)                (0.31)                    (0.29)                
## l.loggdppc                        -3.75     -5.41     -5.14 *     -4.72    -13.91 ***   -13.86 ***   -10.49 ***   -10.48 ***
##                                  (11.20)   (11.40)    (2.41)      (2.41)    (0.72)       (0.72)       (0.61)       (0.61)   
## l.logpop                           7.03     -1.66      1.04        0.88    -21.23 ***   -21.27 ***    -3.91 **     -3.83 ** 
##                                  (26.36)   (26.41)    (6.16)      (6.18)    (1.86)       (1.85)       (1.43)       (1.43)   
## infmort_lag                       -0.15     -0.24      0.03        0.05     -0.02        -0.02         0.02         0.02    
##                                   (0.25)    (0.25)    (0.07)      (0.07)    (0.02)       (0.02)       (0.02)       (0.02)   
## l.dem                             -1.62     -0.40     -0.52       -0.30      1.28 ***     1.27 ***    -0.08        -0.11    
##                                   (2.71)    (2.66)    (1.79)      (1.80)    (0.34)       (0.34)       (0.29)       (0.29)   
## lag_log_police_observer_deaths                                     0.59                   3.76 ***                  3.20 ***
##                                                                   (1.83)                 (0.71)                    (0.68)   
## ----------------------------------------------------------------------------------------------------------------------------
## R^2                                0.77      0.75      0.31        0.31      0.35         0.35         0.31         0.31    
## Adj. R^2                           0.69      0.67      0.26        0.26      0.34         0.34         0.30         0.30    
## Num. obs.                         56        56      1323        1323      6665         6665         7988         7988       
## ============================================================================================================================
## Standard errors are in parentheses. *** p < 0.001; ** p < 0.01; * p < 0.05

Table 6: Aid from pivotal states and personnel contributions: Results of a hurdle model

# Load required packages
library(tidyverse)
library(pscl)
## Classes and Methods for R originally developed in the
## Political Science Computational Laboratory
## Department of Political Science
## Stanford University (2002-2015),
## by and under the direction of Simon Jackman.
## hurdle and zeroinfl functions by Achim Zeileis.
library(texreg)

# Define a list of models with their formulas and data subsets
models <- list(
  list(
    formula = Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 2000 & year < 2016 & dac == 0)
  ),
  list(
    formula = NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 2000 & year < 2016 & dac == 0)
  ),
  list(
    formula = Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1990 & year < 2016 & dac == 0)
  ),
  list(
    formula = NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1990 & year < 2016 & dac == 0)
  ),
  list(
    formula = Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1971 & year < 2016 & dac == 0)
  ),
  list(
    formula = NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1971 & year < 2016 & dac == 0)
  )
)

# Fit the models and store the results
model_results <- models %>%
  map(~ hurdle(
    formula = .x$formula,
    data = .x$data,
    dist = "negbin",
    zero.dist = "binomial"
  ))

# Display results with texreg and screenreg
texreg(model_results, digits = 2, custom.note = "Standard errors are in parentheses. %stars")
## 
## \begin{table}
## \begin{center}
## \begin{tabular}{l c c c c c c}
## \hline
##  & Model 1 & Model 2 & Model 3 & Model 4 & Model 5 & Model 6 \\
## \hline
## Count model: (Intercept)            & $-1.42$       & $3.37^{***}$  & $0.73$        & $4.37^{***}$  & $2.52^{**}$   & $4.35^{***}$  \\
##                                     & $(1.37)$      & $(0.45)$      & $(0.95)$      & $(0.40)$      & $(0.79)$      & $(0.40)$      \\
## Count model: lag\_log\_pivotal\_aid & $0.03^{***}$  & $0.03^{***}$  & $0.02^{**}$   & $0.04^{***}$  & $0.02^{**}$   & $0.04^{***}$  \\
##                                     & $(0.01)$      & $(0.00)$      & $(0.01)$      & $(0.00)$      & $(0.01)$      & $(0.00)$      \\
## Count model: l.loggdppc             & $-0.20^{***}$ & $-0.40^{***}$ & $-0.23^{***}$ & $-0.36^{***}$ & $-0.24^{***}$ & $-0.36^{***}$ \\
##                                     & $(0.06)$      & $(0.02)$      & $(0.05)$      & $(0.02)$      & $(0.05)$      & $(0.02)$      \\
## Count model: l.logpop               & $0.28^{***}$  & $0.09^{***}$  & $0.22^{***}$  & $0.07^{***}$  & $0.21^{***}$  & $0.07^{***}$  \\
##                                     & $(0.04)$      & $(0.02)$      & $(0.03)$      & $(0.02)$      & $(0.03)$      & $(0.02)$      \\
## Count model: ongoingPKO             & $0.01$        & $-0.06^{***}$ & $0.01$        & $-0.11^{***}$ & $-0.06^{***}$ & $-0.11^{***}$ \\
##                                     & $(0.04)$      & $(0.02)$      & $(0.02)$      & $(0.01)$      & $(0.02)$      & $(0.01)$      \\
## Count model: contig\_dummy          & $0.65^{*}$    & $0.27^{*}$    & $0.51^{*}$    & $0.27^{*}$    & $0.51^{*}$    & $0.27^{*}$    \\
##                                     & $(0.27)$      & $(0.14)$      & $(0.25)$      & $(0.13)$      & $(0.24)$      & $(0.13)$      \\
## Count model: lag\_contributed\_5yr  & $0.02^{***}$  & $0.03^{***}$  & $0.02^{***}$  & $0.03^{***}$  & $0.02^{***}$  & $0.03^{***}$  \\
##                                     & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      \\
## Count model: l.dem                  & $-0.27^{*}$   & $-0.36^{***}$ & $-0.35^{**}$  & $-0.33^{***}$ & $-0.30^{**}$  & $-0.33^{***}$ \\
##                                     & $(0.13)$      & $(0.05)$      & $(0.12)$      & $(0.05)$      & $(0.11)$      & $(0.05)$      \\
## Count model: Log(theta)             & $-4.52^{***}$ & $-1.98^{***}$ & $-3.96^{***}$ & $-1.96^{***}$ & $-3.64^{***}$ & $-1.95^{***}$ \\
##                                     & $(0.92)$      & $(0.09)$      & $(0.48)$      & $(0.08)$      & $(0.35)$      & $(0.08)$      \\
## Zero model: (Intercept)             & $-3.33^{***}$ & $-3.52^{***}$ & $-3.73^{***}$ & $-4.88^{***}$ & $-5.17^{***}$ & $-5.88^{***}$ \\
##                                     & $(0.39)$      & $(0.28)$      & $(0.32)$      & $(0.24)$      & $(0.28)$      & $(0.22)$      \\
## Zero model: lag\_log\_pivotal\_aid  & $0.04^{***}$  & $0.03^{***}$  & $0.04^{***}$  & $0.03^{***}$  & $0.04^{***}$  & $0.03^{***}$  \\
##                                     & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      \\
## Zero model: l.loggdppc              & $-0.14^{***}$ & $-0.14^{***}$ & $-0.10^{***}$ & $-0.09^{***}$ & $-0.11^{***}$ & $-0.09^{***}$ \\
##                                     & $(0.02)$      & $(0.01)$      & $(0.02)$      & $(0.01)$      & $(0.02)$      & $(0.01)$      \\
## Zero model: l.logpop                & $0.08^{***}$  & $0.06^{***}$  & $0.10^{***}$  & $0.09^{***}$  & $0.11^{***}$  & $0.10^{***}$  \\
##                                     & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      \\
## Zero model: ongoingPKO              & $-0.09^{***}$ & $0.00$        & $-0.11^{***}$ & $0.02^{***}$  & $-0.03^{***}$ & $0.07^{***}$  \\
##                                     & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      & $(0.01)$      \\
## Zero model: contig\_dummy           & $0.28^{**}$   & $-0.16$       & $0.24^{*}$    & $-0.18^{*}$   & $0.20^{*}$    & $-0.18^{*}$   \\
##                                     & $(0.10)$      & $(0.09)$      & $(0.10)$      & $(0.08)$      & $(0.09)$      & $(0.08)$      \\
## Zero model: lag\_contributed\_5yr   & $0.06^{***}$  & $0.06^{***}$  & $0.06^{***}$  & $0.06^{***}$  & $0.06^{***}$  & $0.06^{***}$  \\
##                                     & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      & $(0.00)$      \\
## Zero model: l.dem                   & $0.29^{***}$  & $0.16^{***}$  & $0.31^{***}$  & $0.14^{***}$  & $0.32^{***}$  & $0.15^{***}$  \\
##                                     & $(0.05)$      & $(0.03)$      & $(0.04)$      & $(0.03)$      & $(0.04)$      & $(0.03)$      \\
## \hline
## AIC                                 & $44556.36$    & $72686.31$    & $53358.33$    & $87372.48$    & $54888.92$    & $87658.15$    \\
## Log Likelihood                      & $-22261.18$   & $-36326.16$   & $-26662.16$   & $-43669.24$   & $-27427.46$   & $-43812.07$   \\
## Num. obs.                           & $44718$       & $44718$       & $62032$       & $62032$       & $67008$       & $67008$       \\
## \hline
## \multicolumn{7}{l}{\scriptsize{Standard errors are in parentheses. $^{***}p<0.001$; $^{**}p<0.01$; $^{*}p<0.05$}}
## \end{tabular}
## \caption{Statistical models}
## \label{table:coefficients}
## \end{center}
## \end{table}
screenreg(model_results, digits = 2, custom.note = "Standard errors are in parentheses. %stars")
## 
## ==========================================================================================================================
##                                   Model 1        Model 2        Model 3        Model 4        Model 5        Model 6      
## --------------------------------------------------------------------------------------------------------------------------
## Count model: (Intercept)              -1.42           3.37 ***       0.73           4.37 ***       2.52 **        4.35 ***
##                                       (1.37)         (0.45)         (0.95)         (0.40)         (0.79)         (0.40)   
## Count model: lag_log_pivotal_aid       0.03 ***       0.03 ***       0.02 **        0.04 ***       0.02 **        0.04 ***
##                                       (0.01)         (0.00)         (0.01)         (0.00)         (0.01)         (0.00)   
## Count model: l.loggdppc               -0.20 ***      -0.40 ***      -0.23 ***      -0.36 ***      -0.24 ***      -0.36 ***
##                                       (0.06)         (0.02)         (0.05)         (0.02)         (0.05)         (0.02)   
## Count model: l.logpop                  0.28 ***       0.09 ***       0.22 ***       0.07 ***       0.21 ***       0.07 ***
##                                       (0.04)         (0.02)         (0.03)         (0.02)         (0.03)         (0.02)   
## Count model: ongoingPKO                0.01          -0.06 ***       0.01          -0.11 ***      -0.06 ***      -0.11 ***
##                                       (0.04)         (0.02)         (0.02)         (0.01)         (0.02)         (0.01)   
## Count model: contig_dummy              0.65 *         0.27 *         0.51 *         0.27 *         0.51 *         0.27 *  
##                                       (0.27)         (0.14)         (0.25)         (0.13)         (0.24)         (0.13)   
## Count model: lag_contributed_5yr       0.02 ***       0.03 ***       0.02 ***       0.03 ***       0.02 ***       0.03 ***
##                                       (0.00)         (0.00)         (0.00)         (0.00)         (0.00)         (0.00)   
## Count model: l.dem                    -0.27 *        -0.36 ***      -0.35 **       -0.33 ***      -0.30 **       -0.33 ***
##                                       (0.13)         (0.05)         (0.12)         (0.05)         (0.11)         (0.05)   
## Count model: Log(theta)               -4.52 ***      -1.98 ***      -3.96 ***      -1.96 ***      -3.64 ***      -1.95 ***
##                                       (0.92)         (0.09)         (0.48)         (0.08)         (0.35)         (0.08)   
## Zero model: (Intercept)               -3.33 ***      -3.52 ***      -3.73 ***      -4.88 ***      -5.17 ***      -5.88 ***
##                                       (0.39)         (0.28)         (0.32)         (0.24)         (0.28)         (0.22)   
## Zero model: lag_log_pivotal_aid        0.04 ***       0.03 ***       0.04 ***       0.03 ***       0.04 ***       0.03 ***
##                                       (0.00)         (0.00)         (0.00)         (0.00)         (0.00)         (0.00)   
## Zero model: l.loggdppc                -0.14 ***      -0.14 ***      -0.10 ***      -0.09 ***      -0.11 ***      -0.09 ***
##                                       (0.02)         (0.01)         (0.02)         (0.01)         (0.02)         (0.01)   
## Zero model: l.logpop                   0.08 ***       0.06 ***       0.10 ***       0.09 ***       0.11 ***       0.10 ***
##                                       (0.01)         (0.01)         (0.01)         (0.01)         (0.01)         (0.01)   
## Zero model: ongoingPKO                -0.09 ***       0.00          -0.11 ***       0.02 ***      -0.03 ***       0.07 ***
##                                       (0.01)         (0.01)         (0.01)         (0.01)         (0.01)         (0.01)   
## Zero model: contig_dummy               0.28 **       -0.16           0.24 *        -0.18 *         0.20 *        -0.18 *  
##                                       (0.10)         (0.09)         (0.10)         (0.08)         (0.09)         (0.08)   
## Zero model: lag_contributed_5yr        0.06 ***       0.06 ***       0.06 ***       0.06 ***       0.06 ***       0.06 ***
##                                       (0.00)         (0.00)         (0.00)         (0.00)         (0.00)         (0.00)   
## Zero model: l.dem                      0.29 ***       0.16 ***       0.31 ***       0.14 ***       0.32 ***       0.15 ***
##                                       (0.05)         (0.03)         (0.04)         (0.03)         (0.04)         (0.03)   
## --------------------------------------------------------------------------------------------------------------------------
## AIC                                44556.36       72686.31       53358.33       87372.48       54888.92       87658.15    
## Log Likelihood                    -22261.18      -36326.16      -26662.16      -43669.24      -27427.46      -43812.07    
## Num. obs.                          44718          44718          62032          62032          67008          67008       
## ==========================================================================================================================
## Standard errors are in parentheses. *** p < 0.001; ** p < 0.01; * p < 0.05

Figures:

Figures are not used in research for aesthetic purposes, depending on their position on the paper, a figure can initiate an understanding, support a claim or most of the times to ease the understanding of qunatities. ### Figure 1 : UN peacekeeping troop contributions

This paper supports the claim that missions have significantly increased in number, scope, and ambition since the 1990s, and that the division of labor between industrialized and developing countries has become more pronounced.

library(dplyr)
library(plotly)
## Warning: package 'plotly' was built under R version 4.1.3
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
# Check if 'data' is a data frame or tibble
if (!is.data.frame(data)) {
  stop("The 'data' object is not a data frame or tibble.")
}

# Check column names
print(names(data))
##  [1] "FirstMission"                   "ccodecow"                      
##  [3] "year"                           "Pivotal"                       
##  [5] "country"                        "Mission_Country"               
##  [7] "Mission_Country_ccodecow"       "decade"                        
##  [9] "PKinState"                      "numBorderPKs"                  
## [11] "dac"                            "oecd_flag"                     
## [13] "Total"                          "Troops"                        
## [15] "NonCombatPers"                  "token_contributor"             
## [17] "token_1_10"                     "token_11_40"                   
## [19] "major_contributor"              "non_contributor"               
## [21] "lag_major_contributor"          "lag_non_contributor"           
## [23] "lag_token_contributor"          "lag_token_1_10"                
## [25] "lag_token_11_40"                "total_deaths"                  
## [27] "troop_deaths"                   "police_observer_deaths"        
## [29] "log_total_deaths"               "log_troop_deaths"              
## [31] "log_police_observer_deaths"     "lag_log_total_deaths"          
## [33] "lag_log_troop_deaths"           "lag_log_police_observer_deaths"
## [35] "total_deathsPC"                 "troop_deathsPC"                
## [37] "police_observer_deathsPC"       "lag_total_deathsPC"            
## [39] "lag_troop_deathsPC"             "lag_police_observer_deathsPC"  
## [41] "pivotal_aid"                    "log_pivotal_aid"               
## [43] "lag_log_pivotal_aid"            "conttype"                      
## [45] "contig_dummy"                   "PKinStateYear"                 
## [47] "ongoingPKO"                     "contributed"                   
## [49] "lag_contributed"                "contributed_yr"                
## [51] "contributed_5yr"                "lag_contributed_5yr"           
## [53] "lag_contributed_yr"             "inf_mort"                      
## [55] "infmort_lag"                    "PTS_A"                         
## [57] "PTS_S"                          "pts_lag"                       
## [59] "p_polity"                       "WDI_GDPPC2000"                 
## [61] "WDI_GDP2000"                    "WDI_Pop"                       
## [63] "Democracy"                      "loggdp"                        
## [65] "loggdppc"                       "logpop"                        
## [67] "l.loggdp"                       "l.loggdppc"                    
## [69] "l.logpop"                       "l.gdp"                         
## [71] "l.pop"                          "l.dem"
# Prepare the data
plotdata <- data %>%
  dplyr::select(year, country, Troops, dac) %>%  # Ensure these columns exist in 'data'
  mutate(dacleg = ifelse(dac == 1, "DAC", "Non-DAC")) %>%
  group_by(year, dacleg) %>%
  summarise(Troops = sum(Troops), .groups = 'drop') %>%
  arrange(year)

# Create the plot
fig <- plot_ly(
  data = plotdata,
  x = ~year,
  y = ~Troops,
  color = ~dacleg,
  type = 'bar',
  text = ~Troops,
  textposition = 'auto',
  colors = c("Non-DAC" = "lightgrey", "DAC" = "black")
) %>%
  layout(
    title = "",
    xaxis = list(title = "Year"),
    yaxis = list(title = "Troop Contributions"),
    barmode = 'group',
    legend = list(title = list(text = 'DAC Status')),
    xaxis = list(tickfont = list(size = 14)),
    yaxis = list(tickfont = list(size = 14)),
    legend = list(font = list(size = 14))
  )

# Display the plot
fig

Figure 2 : Substantive effects of personnel fatalities on aid received

Figure 2 illustrates the substantive effects of increases in both types of personnel fatalities on the expected amount of aid received. It supports the theoretical proposition that contributors experiencing more fatalities of either type receive significantly more foreign aid from pivotal states in the following year.

library(plotly)
library(ggplot2)
library(dplyr)
library(broom)

# Fit the models
model16_fig2 <- lm(log_pivotal_aid ~ lag_log_troop_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem, 
                   subset = year > 1989 & year < 2016 & dac == 0 & lag_contributed == 1, 
                   data = data)
model17_fig2 <- lm(log_pivotal_aid ~ lag_log_police_observer_deaths + l.loggdppc + l.logpop + infmort_lag + l.dem, 
                   subset = year > 1989 & year < 2016 & dac == 0 & lag_contributed == 1, 
                   data = data)

# Create prediction data
create_prediction_data <- function(model, var_name) {
  # Extract model terms
  terms <- attr(model$terms, "term.labels")
  
  # Generate new data for prediction
  new_data <- data.frame(var_name = seq(min(data[[var_name]], na.rm = TRUE), 
                                         max(data[[var_name]], na.rm = TRUE), 
                                         length.out = 100))
  names(new_data) <- var_name
  
  # Add other variables with mean values
  for (term in terms) {
    if (term != var_name) {
      new_data[[term]] <- mean(data[[term]], na.rm = TRUE)
    }
  }
  
  # Predict values
  preds <- predict(model, newdata = new_data, interval = "confidence")
  
  # Combine predictions with new data
  pred_data <- new_data %>%
    mutate(yvals = preds[, "fit"],
           lower = preds[, "lwr"],
           upper = preds[, "upr"]) %>%
    rename(xvals = var_name)
  
  return(pred_data)
}

# Create prediction data for both models
cdat16 <- create_prediction_data(model16_fig2, "lag_log_troop_deaths")
## Warning: Using an external vector in selections was deprecated in tidyselect 1.1.0.
## i Please use `all_of()` or `any_of()` instead.
##   # Was:
##   data %>% select(var_name)
## 
##   # Now:
##   data %>% select(all_of(var_name))
## 
## See <https://tidyselect.r-lib.org/reference/faq-external-vector.html>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
cdat17 <- create_prediction_data(model17_fig2, "lag_log_police_observer_deaths")

# Plot with plotly
p1 <- plot_ly(cdat16, x = ~xvals, y = ~yvals, type = 'scatter', mode = 'lines', 
              name = 'Predicted Value', line = list(width = 2)) %>%
  add_trace(y = ~upper, mode = 'lines', line = list(width = 1, dash = 'dash'), name = 'Upper CI') %>%
  add_trace(y = ~lower, mode = 'lines', line = list(width = 1, dash = 'dash'), name = 'Lower CI') %>%
  layout(title = "Predicted ln(aid received) vs. ln(troop deaths)",
         xaxis = list(title = "ln(troop deaths)"),
         yaxis = list(title = "Predicted value of ln(aid received)"),
         margin = list(l = 60, r = 10, b = 50, t = 50))

p2 <- plot_ly(cdat17, x = ~xvals, y = ~yvals, type = 'scatter', mode = 'lines', 
              name = 'Predicted Value', line = list(width = 2)) %>%
  add_trace(y = ~upper, mode = 'lines', line = list(width = 1, dash = 'dash'), name = 'Upper CI') %>%
  add_trace(y = ~lower, mode = 'lines', line = list(width = 1, dash = 'dash'), name = 'Lower CI') %>%
  layout(title = "Predicted ln(aid received) vs. ln(police + observer deaths)",
         xaxis = list(title = "ln(police + observer deaths)"),
         yaxis = list(title = "Predicted value of ln(aid received)"),
         margin = list(l = 60, r = 10, b = 50, t = 50))

# Display the plots
subplot(p1, p2, nrows = 1, margin = 0.05)

Figure 3: Effect of aid from pivotal states on personnel contributions

This figure further explores Hypothesis 4, which suggests that states will respond to foreign aid from pivotal states by increasing the size of their deployments. It also aligns with anecdotal evidence of major powers using inducements and coercion to assemble peacekeeping missions.

library(forecast)
## Warning: package 'forecast' was built under R version 4.1.3
## Registered S3 method overwritten by 'quantmod':
##   method            from
##   as.zoo.data.frame zoo
library(dplyr)

# Define a list of models with their formulas and data subsets
models <- list(
  model64 = hurdle(
    Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 2000 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  ),
  model62 = hurdle(
    NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 2000 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  ),
  model66 = hurdle(
    Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1990 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  ),
  model63 = hurdle(
    Troops ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1971 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  ),
  model61 = hurdle(
    NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1971 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  ),
  model65 = hurdle(
    NonCombatPers ~ lag_log_pivotal_aid + l.loggdppc + l.logpop + ongoingPKO + contig_dummy + lag_contributed_5yr + l.dem,
    data = data %>% filter(year >= 1990 & year < 2016 & dac == 0),
    dist = "negbin",
    zero.dist = "binomial"
  )
)

library(plotly)

# Define prediction sequences
aidseq <- seq(from = min(data$lag_log_pivotal_aid, na.rm = TRUE), 
              to = max(data$lag_log_pivotal_aid, na.rm = TRUE), 
              by = 0.5)

# Define datasets for prediction
ndb <- data.frame(
  lag_log_pivotal_aid = aidseq,
  l.loggdppc = mean(data$l.loggdppc, na.rm = TRUE),
  l.logpop = mean(data$l.logpop, na.rm = TRUE),
  ongoingPKO = mean(data$ongoingPKO),
  contig_dummy = mean(data$contig_dummy),
  lag_contributed_5yr = mean(data$lag_contributed_5yr, na.rm = TRUE),
  l.dem = median(data$l.dem, na.rm = TRUE)
)

ndc <- data %>% filter(year >= 2000 & year <= 2015) %>%
  summarize(l.loggdppc = mean(l.loggdppc, na.rm = TRUE),
            l.logpop = mean(l.logpop, na.rm = TRUE),
            ongoingPKO = mean(ongoingPKO),
            contig_dummy = mean(contig_dummy),
            lag_contributed_5yr = mean(lag_contributed_5yr, na.rm = TRUE),
            l.dem = median(l.dem, na.rm = TRUE))
ndc <- data.frame(lag_log_pivotal_aid = aidseq, ndc)

ndd <- data %>% filter(year >= 1971 & year <= 2015) %>%
  summarize(l.loggdppc = mean(l.loggdppc, na.rm = TRUE),
            l.logpop = mean(l.logpop, na.rm = TRUE),
            ongoingPKO = mean(ongoingPKO),
            contig_dummy = mean(contig_dummy),
            lag_contributed_5yr = mean(lag_contributed_5yr, na.rm = TRUE),
            l.dem = median(l.dem, na.rm = TRUE))
ndd <- data.frame(lag_log_pivotal_aid = aidseq, ndd)

# Predict values for each model
allmean1 <- predict(models$model64, newdata = ndb, type = "response") # 1990-2015
allmean2 <- predict(models$model62, newdata = ndc, type = "response") # 2000-2015
allmean3 <- predict(models$model66, newdata = ndd, type = "response") # 1971-2015

allmean4 <- predict(models$model63, newdata = ndb, type = "response") # 1990-2015 
allmean5 <- predict(models$model61, newdata = ndc, type = "response") # 2000-2015
allmean6 <- predict(models$model65, newdata = ndd, type = "response") # 1971-2015

# Create data for plotting
plot_data1 <- data.frame(aidseq = aidseq, allmean1 = allmean1, allmean2 = allmean2, allmean3 = allmean3)
plot_data2 <- data.frame(aidseq = aidseq, allmean4 = allmean4, allmean5 = allmean5, allmean6 = allmean6)

# Plot using plotly
p1 <- plot_ly(plot_data1, x = ~aidseq) %>%
  add_lines(y = ~allmean1, name = "1990-2015", line = list(color = 'black')) %>%
  add_lines(y = ~allmean2, name = "2000-2015", line = list(color = 'blue')) %>%
  add_lines(y = ~allmean3, name = "1971-2015", line = list(color = 'red')) %>%
  layout(title = "Effect of aid on non-combat personnel contributions",
         xaxis = list(title = "Lag of ln(aid from pivotal states)"),
         yaxis = list(title = "Expected ln(contribution) per mission"),
         legend = list(x = 0.1, y = 0.9))

p2 <- plot_ly(plot_data2, x = ~aidseq) %>%
  add_lines(y = ~allmean4, name = "1990-2015", line = list(color = 'black')) %>%
  add_lines(y = ~allmean5, name = "2000-2015", line = list(color = 'blue')) %>%
  add_lines(y = ~allmean6, name = "1971-2015", line = list(color = 'red')) %>%
  layout(title = "Effect of aid on UN troop deployment size",
         xaxis = list(title = "Lag of ln(aid from pivotal states)"),
         yaxis = list(title = "Expected ln(contribution) per mission"),
         legend = list(x = 0.1, y = 0.9))

# Arrange the plots side by side
subplot(p1, p2, nrows = 1, shareX = TRUE, shareY = TRUE)

References

Boutton, Andrew, and Vito D’Orazio. 2020. “Buying Blue Helmets: The Role of Foreign Aid in the Construction of UN Peacekeeping Missions.” Journal of Peace Research 57 (2): 312–28.